﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using SimhoppKjellsFavoriterVT13;

namespace Kjellsfavoriter_TEST
{
    [TestFixture]
    class Contest_test
    {
        Contest testContest;

        string contestantName1, contestantName2, contestantName3, judgeName1, judgeName2, judgeName3, contestantNationality1, contestantNationality2, contestantNationality3, judgeNationality1, judgeNationality2, judgeNationality3;
        DateTime contestantBirthdate1, contestantBirthdate2, contestantBirthdate3, judgeBirthdate1, judgeBirthdate2, judgeBirthdate3;
        
        Gender m, f;

        [SetUp]
        protected void SetUp()
        {
            contestantBirthdate1 = new DateTime();
            contestantBirthdate2 = new DateTime();
            contestantBirthdate3 = new DateTime();
            judgeBirthdate1 = new DateTime();
            judgeBirthdate2 = new DateTime();
            judgeBirthdate3 = new DateTime();

            contestantName1 = "a";
            contestantName2 = "b";
            contestantName3 = "c";
            judgeName1 = "d";
            judgeName2 = "e";
            judgeName3 = "f";
            contestantNationality1 = "grenada";
            contestantNationality2 = "hungary";
            contestantNationality3 = "iran";
            judgeNationality1 = "japan";
            judgeNationality2 = "kuwait";
            judgeNationality3 = "laos";
            contestantBirthdate1.AddYears(1981);
            contestantBirthdate1.AddMonths(1);
            contestantBirthdate1.AddDays(1);
            contestantBirthdate2.AddYears(1982);
            contestantBirthdate2.AddMonths(2);
            contestantBirthdate2.AddDays(2);
            contestantBirthdate3.AddYears(1983);
            contestantBirthdate3.AddMonths(3);
            contestantBirthdate3.AddDays(3);
            judgeBirthdate1.AddYears(1984);
            judgeBirthdate1.AddMonths(4);
            judgeBirthdate1.AddDays(4);
            judgeBirthdate2.AddYears(1985);
            judgeBirthdate2.AddMonths(5);
            judgeBirthdate2.AddDays(5);
            judgeBirthdate3.AddYears(1986);
            judgeBirthdate3.AddMonths(6);
            judgeBirthdate3.AddDays(6);

            m = Gender.male;
            f = Gender.female;
        }

        [Test]
        public void Test_AddContestant_n_AddJudge()
        {
            testContest = new Contest();

            testContest.addContestant(contestantName1, contestantBirthdate1, m, contestantNationality1, 1);
            testContest.addContestant(contestantName2, contestantBirthdate2, f, contestantNationality2, 2);
            testContest.addContestant(contestantName3, contestantBirthdate3, m, contestantNationality3, 3);
            testContest.addJudge(judgeName1, judgeBirthdate1, f, judgeNationality1, 4);
            testContest.addJudge(judgeName2, judgeBirthdate2, m, judgeNationality2, 5);
            testContest.addJudge(judgeName3, judgeBirthdate3, f, judgeNationality3, 6);

            #region olikatest

            Assert.AreEqual("a", testContest.Contestants[0].name);
            Assert.AreEqual("b", testContest.Contestants[1].name);

            Assert.AreEqual(judgeBirthdate1, testContest.Judges[0].birthDate);
            Assert.AreEqual(judgeBirthdate3, testContest.Contestants[2].birthDate);

            Assert.AreEqual(m, testContest.Judges[1].g);
            Assert.AreEqual(f, testContest.Judges[2].g);

            Assert.AreEqual("hungary", testContest.Contestants[1].nationality);
            Assert.AreEqual("kuwait", testContest.Judges[1].nationality);

            Assert.AreEqual(2, testContest.Contestants[1].ID);
            Assert.AreEqual(3, testContest.Contestants[2].ID);

            #endregion

        }

    }
}
